﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using FluentValidation.Attributes;
using Nop.Admin.Validators.Catalog;
using Nop.Web.Framework;
using Nop.Web.Framework.Localization;
using Nop.Web.Framework.Mvc;
using Telerik.Web.Mvc;

namespace Nop.Admin.Models.Advert
{

    public partial class AdvertisementModel : BaseNopEntityModel, ILocalizedModel<AdvertisementLocalizedModel>
    {
        public AdvertisementModel()
        {
            Locales = new List<AdvertisementLocalizedModel>();
            //AvailableManufacturerTemplates = new List<SelectListItem>();
            AvailableAdvertTypeTemplates = new List<SelectListItem>();
            AvailableAdverPositionTemplates = new List<SelectListItem>();
            AvailableAdverLevelTemplates = new List<SelectListItem>();
        }

        [NopResourceDisplayName("Admin.Advert.Advertisement.Fields.Name")]
        [AllowHtml]
        public string Name { get; set; }

        [NopResourceDisplayName("Admin.Advert.Advertisement.Fields.Description")]
        [AllowHtml]
        public string Description { get; set; }

        [NopResourceDisplayName("Admin.Advert.Advertisement.Fields.MapId")]
        [AllowHtml]
        public int MapId { get; set; }

        /// <summary>
        /// 广告类型
        /// </summary>
        [NopResourceDisplayName("Admin.Advert.Advertisement.Fields.AdverType")]
        public  int AdverType { get; set; }

        /// <summary>
        /// 广告位置
        /// 1.顶部
        /// 2.头部
        /// 3.页面
        /// 4.两侧
        /// 5.两侧浮动
        /// 6.底部
        /// 7.顶部拉升
        /// </summary>
       [NopResourceDisplayName("Admin.Advert.Advertisement.Fields.AdverPosition")]
        public  int AdverPosition { get; set; }

       /// <summary>
       /// 等级
       /// 1级：首页
       /// 2级：内页
       /// 3级：子内页
       /// 4级：未知
       /// </summary>
       [NopResourceDisplayName("Admin.Advert.Advertisement.Fields.AdverLevel")]
       public virtual int AdverLevel { get; set; }

        [NopResourceDisplayName("Admin.Advert.Advertisement.Fields.StartTime")]
        [UIHint("DateNullable")]
        public DateTime StartTime { get; set; }

        [NopResourceDisplayName("Admin.Advert.Advertisement.Fields.EndTime")]
        [UIHint("DateNullable")]
        public DateTime EndTime { get; set; }

        /// <summary>
        /// 广告内容
        /// </summary>
        [NopResourceDisplayName("Admin.Advert.Advertisement.Fields.AdvertContent")]
        [AllowHtml]
        public  string AdvertContent { get; set; }

        [NopResourceDisplayName("Admin.Advert.Advertisement.Fields.OrderId")]
        public int OrderId { get; set; }

        [NopResourceDisplayName("Admin.Advert.Advertisement.Fields.CreatedOnUtc")]
        [AllowHtml]
        public DateTime CreatedOnUtc { get; set; }

        /// <summary>
        ///是否是删除数据
        /// </summary>
        [NopResourceDisplayName("Admin.Advert.Advertisement.Fields.Deleted")]
        public  bool Deleted { get; set; }
        /// <summary>
        /// 是否发布
        /// </summary>
         [NopResourceDisplayName("Admin.Advert.Advertisement.Fields.Published")]
        public  bool Published { get; set; }

         [NopResourceDisplayName("Admin.Advert.Advertisement.Fields.DisplayOrder")]
         public int DisplayOrder { get; set; }

         public string Url { get; set; }

        public IList<AdvertisementLocalizedModel> Locales { get; set; }

        #region 新加
        public IList<SelectListItem> AvailableAdvertTypeTemplates { get; set; }
        public IList<SelectListItem> AvailableAdverPositionTemplates { get; set; }
        public IList<SelectListItem> AvailableAdverLevelTemplates { get; set; }
        #endregion
    }

    public partial class AdvertisementLocalizedModel : ILocalizedModelLocal
    {
        public int LanguageId { get; set; }

        [NopResourceDisplayName("Admin.Advert.Advertisement.Fields.Name")]
        [AllowHtml]
        public string Name { get; set; }

        [NopResourceDisplayName("Admin.Advert.Advertisement.Fields.Description")]
        [AllowHtml]
        public string Description { get; set; }

        [NopResourceDisplayName("Admin.Advert.Advertisement.Fields.MapId")]
        [AllowHtml]
        public int MapId { get; set; }

        [NopResourceDisplayName("Admin.Advert.Advertisement.Fields.StartTime")]
        [AllowHtml]
        public DateTime StartTime { get; set; }

        [NopResourceDisplayName("Admin.Advert.Advertisement.Fields.EndTime")]
        [AllowHtml]
        public DateTime EndTime { get; set; }

        #region 新加
        public IList<SelectListItem> AvailableAdvertTypeTemplates { get; set; }
        public IList<SelectListItem> AvailableAdverPositionTemplates { get; set; }
        public IList<SelectListItem> AvailableAdverLevelTemplates { get; set; }
        #endregion
    }
}